/********************************************************************************
 *      Copyright:  (C) 2023 iot<iot@email.com>
 *                  All rights reserved.
 *
 *       Filename:  logger.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(03/10/23)
 *         Author:  iot <iot@email.com>
 *      ChangeLog:  1, Release initial version on "03/10/23 09:27:17"
 *                 
 ********************************************************************************/

#ifndef _LOGGER_H_
#define _LOGGER_H_

/*logger level*/
enum
{
	LOG_LEVEL_CRITICAL,
	LOG_LEVEL_ERROR,
	LOG_LEVEL_WARNING,
	LOG_LEVEL_INFO,
	LOG_LEVEL_DEBUG,
	LOG_LEVEL_MAX,
};

#define LOG_STRING_CRITICAL	"CRITICAL"
#define LOG_STRING_ERROR 	"ERROR"
#define LOG_STRING_WARNING 	"WARNING"
#define LOG_STRING_INFO		"INFO"
#define LOG_STRING_DEBUG	"DEBUG"

int logger_init(char *fliename,int loglevel);
void logger_term(void);

/*logging methods by level*/
void log_critical(char *format,...);
void log_error(char *format,...);
void log_warning(char *format,...);
void log_info(char *format,...);
void log_debug(char *format,...);

#endif	/* --- #define _LOGGER_H_ --- */

